package leetcode.weekly.week315;

import java.util.HashSet;
import java.util.Set;

//Solution2Test
public class Solution2 {

	public int countDistinctIntegers(int[] nums) {
		Set<Integer> set = new HashSet<>();
		for (int num : nums) {
			set.add(num);
			set.add(this.f(num));
		}
		return set.size();
	}

	private int f(int num) {
		int ans = 0;
		while (num > 0) {
			int last = num % 10;
			ans = ans * 10 + last;
			num /= 10;
		}
		return ans;
	}

}
